<template>
  <div>
    <a-row>
      <a-col :span="20">
        <!-- 供应商 -->

        <a-input disabled v-model='curValue' :placeholder='placeholder'></a-input>
      </a-col>
      <a-col :span="4">
        <a-button type="primary" @click="handleOpenChoose" style="padding: 0 5px;width: 70px">
          <a-icon type="search" />
        </a-button>
      </a-col>
    </a-row>
    <InventoryChoose ref="supplierChoose" @onChoose="handleChoose"></InventoryChoose>
  </div>
</template>
<script>
import InventoryChoose from './InventoryChoose.vue'
export default {
  props: {
    value: { type: String, required: false },
    placeholder:{type:String,require:false,default:'请选择'}
  },
  components: {
    InventoryChoose
  },
  data() {
    return {
      curValue: '',
      dataSource: []
    }
  },
  watch: {
    value(value) {
      this.curValue = value
    },
  },
  mounted() {
    // console.log('111')
  },
  methods: {
    handleChoose(e){
      // console.log(e)
      this.curValue = e[0].cInvName
      this.$emit('onConfirm',e[0])
    },
    handleOpenChoose() {
      this.$refs.supplierChoose.openChoose()
    },
  }
}
</script>
